inherited fmPSysDic: TfmPSysDic
  Left = 269
  Top = 128
  Width = 893
  Height = 704
  Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 643
    Width = 885
  end
  inherited Panel1: TPanel
    Width = 885
    inherited BitBtn1: TBitBtn
      Left = 715
    end
    inherited BitBtn2: TBitBtn
      Left = 803
    end
  end
  object Panel2: TPanel [2]
    Left = 0
    Top = 45
    Width = 505
    Height = 598
    Align = alLeft
    BevelOuter = bvNone
    TabOrder = 2
    object tbTop: TToolBar
      Left = 0
      Top = 0
      Width = 505
      Height = 33
      AutoSize = True
      BorderWidth = 2
      ButtonHeight = 23
      EdgeInner = esNone
      EdgeOuter = esNone
      Images = DMInv.ilActive
      TabOrder = 0
      TabStop = True
      Transparent = True
      object tbInsert: TToolButton
        Left = 0
        Top = 2
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100
        ImageIndex = 30
        ParentShowHint = False
        ShowHint = True
      end
      object tbInsertChild: TToolButton
        Left = 23
        Top = 2
        Hint = #1044#1086#1073#1072#1074#1080#1090#1100' '#1087#1086#1090#1086#1084#1082#1072
        Caption = 'tbInsertChild'
        ImageIndex = 32
        ParentShowHint = False
        ShowHint = True
      end
      object tbDelete: TToolButton
        Left = 46
        Top = 2
        Hint = #1059#1076#1072#1083#1080#1090#1100
        ImageIndex = 29
        ParentShowHint = False
        ShowHint = True
      end
      object tbEdit: TToolButton
        Left = 69
        Top = 2
        Hint = #1048#1079#1084#1077#1085#1080#1090#1100
        ImageIndex = 2
        ParentShowHint = False
        ShowHint = True
      end
      object ToolButton3: TToolButton
        Left = 0
        Top = 2
        Width = 8
        Caption = 'ToolButton3'
        ImageIndex = 2
        Wrap = True
        Style = tbsSeparator
      end
    end
    object dbTW: TdxDBTreeView
      Left = 0
      Top = 33
      Width = 505
      Height = 565
      ShowNodeHint = True
      DeletingConfirmationMessage = #1042#1099' '#1076#1077#1081#1089#1090#1074#1080#1090#1077#1083#1100#1085#1086' '#1093#1086#1090#1080#1090#1077' '#1091#1076#1072#1083#1080#1090#1100' '#1101#1083#1077#1084#1077#1085#1090' "%s"'
      RowSelect = True
      DataSource = dsSD
      DisplayField = 'SDNAME'
      KeyField = 'SDID'
      ListField = 'SDNAME'
      ParentField = 'SDPARID'
      RootValue = 0
      SeparatedSt = '-'
      StateIndexField = 'SDISDELETE'
      RaiseOnError = True
      ReadOnly = True
      Indent = 19
      Align = alClient
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -13
      Font.Name = 'Arial'
      Font.Style = []
      ParentColor = False
      Options = [trCanDBNavigate]
      SortType = stText
      SelectedIndex = 1
      TabOrder = 1
      ParentFont = False
      ParentShowHint = False
      ShowHint = False
      StateImages = DMInv.ilBJTree
      IsConfirmationAssigned = True
    end
  end
  object cxSplitter1: TcxSplitter [3]
    Left = 505
    Top = 45
    Width = 8
    Height = 598
    Control = Panel2
  end
  object Panel3: TPanel [4]
    Left = 513
    Top = 45
    Width = 372
    Height = 598
    Align = alClient
    BevelOuter = bvNone
    TabOrder = 4
    object Label1: TLabel
      Left = 0
      Top = 0
      Width = 372
      Height = 13
      Align = alTop
      Caption = #1057#1090#1088#1086#1082#1072' '#1087#1086#1080#1089#1082#1072
    end
    object Panel4: TPanel
      Left = 0
      Top = 13
      Width = 372
      Height = 35
      Align = alTop
      TabOrder = 0
      object Edit1: TEdit
        Left = 5
        Top = 4
        Width = 316
        Height = 27
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 0
      end
    end
    object dbgClients: TcxGrid
      Left = 0
      Top = 48
      Width = 372
      Height = 550
      Align = alClient
      TabOrder = 1
      LookAndFeel.Kind = lfStandard
      object dbgClientsDBTableView1: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        DataController.DataSource = dlgDS
        DataController.Summary.DefaultGroupSummaryItems = <
          item
            Kind = skCount
            Position = spFooter
            FieldName = 'PLASTNAME'
          end>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'FIO'
            Column = dbgClientsDBTableView1PP
          end>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        FilterRow.InfoText = #1065#1077#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1089#1086#1079#1076#1072#1085#1080#1103' '#1092#1080#1083#1100#1090#1088#1072
        NewItemRow.InfoText = #1065#1105#1083#1082#1085#1080#1090#1077' '#1079#1076#1077#1089#1100' '#1076#1083#1103' '#1076#1086#1073#1072#1074#1083#1077#1085#1080#1103' '#1085#1086#1074#1086#1081' '#1089#1090#1088#1086#1082#1080
        OptionsBehavior.CellHints = True
        OptionsBehavior.ImmediateEditor = False
        OptionsBehavior.IncSearch = True
        OptionsBehavior.IncSearchItem = dbgClientsDBTableView1PP
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.Deleting = False
        OptionsData.Editing = False
        OptionsData.Inserting = False
        OptionsSelection.CellSelect = False
        OptionsSelection.HideFocusRectOnExit = False
        OptionsSelection.InvertSelect = False
        OptionsSelection.UnselectFocusedRecordOnExit = False
        OptionsView.NavigatorOffset = 10
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.ColumnAutoWidth = True
        OptionsView.DataRowHeight = 24
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Content = DMInv.cxData
        Styles.IncSearch = DMInv.cxKrasniyText
        Styles.Selection = DMInv.cxJoltiyFon
        Styles.Header = DMInv.cxSiniyText
        object dbgClientsDBTableView1Column1: TcxGridDBColumn
          Caption = #8470
          Options.Sorting = False
          Width = 20
        end
        object dbgClientsDBTableView1PP: TcxGridDBColumn
          DataBinding.FieldName = 'PP'
          Width = 468
        end
        object dbgClientsDBTableView1PDATEBIRTH: TcxGridDBColumn
          DataBinding.FieldName = 'PDATEBIRTH'
          Options.Editing = False
          Width = 113
        end
        object dbgClientsDBTableView1SDNAME: TcxGridDBColumn
          Caption = #1057#1090#1072#1090#1091#1089
          DataBinding.FieldName = 'SDNAME'
          Width = 218
        end
      end
      object dbgClientsLevel1: TcxGridLevel
        GridView = dbgClientsDBTableView1
      end
    end
  end
  inherited dlgDS: TDataSource
    Left = 440
    Top = 128
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.*, (COALESCE(P.PLASTNAME, '#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39 +
        ' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      
        '        (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)||'#39' ai' +
        'aa(eao) e '#39'||'
      '     (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) |' +
        '|'#39' ian.'#39') AS vozrast,'
      
        '     (P.PLASTNAME||'#39' '#39'||COALESCE(SUBSTRING(P.PNAME FROM 1 FOR 1 ' +
        ')||'#39'. '#39', '#39' '#39')||'
      
        '     COALESCE(SUBSTRING(P.PPATRONYMIC FROM 1 FOR 1)||'#39'.'#39','#39' '#39')) A' +
        'S fio, PS.PSTEP,'
      '     SD.SDNAME'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STEPACT PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN P_STATUS PSS ON PSS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PSS.SDID'
      'where P.PISDELETE is null'
      'ORDER BY 3')
    UpdateObject = quPeople
    Left = 472
    Top = 129
    object qPeoplePID: TIntegerField
      DisplayLabel = #1053#1086#1084#1077#1088
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePLASTNAME: TIBStringField
      DisplayLabel = #1060#1072#1084#1080#1083#1080#1103
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePNAME: TIBStringField
      DisplayLabel = #1048#1084#1103
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      DisplayLabel = #1054#1090#1095#1077#1089#1090#1074#1086
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      DisplayLabel = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePNOTE: TIBStringField
      DisplayLabel = #1044#1086#1087#1086#1083#1085#1080#1090#1077#1083#1100#1085#1086
      DisplayWidth = 50
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeoplePP: TIBStringField
      DisplayLabel = #1060#1048#1054
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleVOZRAST: TIBStringField
      DisplayLabel = #1042#1086#1079#1088#1072#1089#1090
      FieldName = 'VOZRAST'
      ProviderFlags = []
      Size = 60
    end
    object qPeopleFIO: TIBStringField
      FieldName = 'FIO'
      ProviderFlags = []
      Size = 769
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
    object qPeoplePSTEP: TIntegerField
      DisplayLabel = #1040#1082#1090#1091#1072#1083#1100#1085#1086#1089#1090#1100
      FieldName = 'PSTEP'
      Origin = '"P_STEPACT"."PSTEP"'
    end
    object qPeopleSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object quPeople: TIBUpdateSQL
    RefreshSQL.Strings = (
      'null;')
    InsertSQL.Strings = (
      '')
    DeleteSQL.Strings = (
      'update PEOPLE'
      'set'
      ''
      '  PISDELETE = 1'
      ''
      'where'
      '  PID = :OLD_PID'
      '')
    Left = 504
    Top = 130
  end
  object qChekChild: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = :SDID'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid')
    Left = 200
    Top = 128
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'SDID'
        ParamType = ptUnknown
      end>
  end
  object quSD: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  SDID,'
      '  SDPARID,'
      '  SDNAME'
      'from SYS_DIC '
      'where'
      '  SDID = :SDID')
    ModifySQL.Strings = (
      'update SYS_DIC'
      'set'
      '  SDID = :SDID,'
      '  SDNAME = trim (leading from :SDNAME),'
      '  SDPARID = :SDPARID'
      'where'
      '  SDID = :OLD_SDID')
    InsertSQL.Strings = (
      'insert into SYS_DIC'
      '  (SDID, SDNAME, SDPARID)'
      'values'
      '  (:SDID, trim (leading from :SDNAME) , :SDPARID)')
    DeleteSQL.Strings = (
      'delete from SYS_DIC'
      'where'
      '  SDID = :OLD_SDID')
    Left = 160
    Top = 128
  end
  object qSD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = :SDPARID'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    UpdateObject = quSD
    GeneratorField.Field = 'SDID'
    GeneratorField.Generator = 'GEN_SYS_DIC'
    Left = 120
    Top = 128
    ParamData = <
      item
        DataType = ftString
        Name = 'SDPARID'
        ParamType = ptUnknown
        Value = '1'
      end>
    object qSDSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qSDSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qSDSDNAME: TIBStringField
      DisplayLabel = #1069#1083#1077#1084#1077#1085#1090
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qSDSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsSD: TDataSource
    DataSet = qSD
    Left = 80
    Top = 125
  end
end
